import { ReqSaveNotifiItem, SendNotifi } from "./models";
import req from "/@/api/req";

export enum Api {
  getMessagePage = "api/msg/notifications/page",
  addNotifications = "api/msg/notifications/addNotifications",
  deleteNotificationsByIds = "api/msg/notifications/deleteNotificationsByIds",
  geNotificationsById = "api/msg/notifications/geNotificationsById",
  updateNotifications = "api/msg/notifications/updateNotifications",
  recoverNotifications = "api/msg/notifications/recoverNotifications", // 收回通告
  sendNotifications = "api/msg/notifications/sendNotifications", // 发布通告
  markNotifications = "api/msg/notifications/markNotifications", // 通知已读
}

export function addNotifications(data: ReqSaveNotifiItem) {
  return req.post<boolean>({
    url: Api.addNotifications,
    data,
  });
}
// 发布
export function sendNotifications(data: SendNotifi) {
  return req.post<boolean>({
    url: Api.sendNotifications,
    data,
  });
}
// 收回
export function recoverNotifications(data: SendNotifi) {
  return req.post<boolean>({
    url: Api.recoverNotifications,
    data,
  });
}
